package com.example.yunJie.digitalSentry.control;

import com.example.yunJie.digitalSentry.entity.VehiclebasicEntity;
import com.example.yunJie.digitalSentry.service.VehiclebasicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/Vehiclebasic")
public class VehiclebasicControl {

    @Autowired
    private VehiclebasicService vehiclebasicService;

    @RequestMapping("/add")
    public void insert(VehiclebasicEntity vehiclebasicEntity) {
        vehiclebasicService.insert(vehiclebasicEntity);
    }

    @RequestMapping("/update")
    public int update(VehiclebasicEntity vehiclebasicEntity) {
        return vehiclebasicService.update(vehiclebasicEntity);
    }

    @RequestMapping("/deleteById")
    public int deleteById(String id) {
        return vehiclebasicService.deleteById(id);
    }

    @RequestMapping("/deleteIdList")
    public int deleteIdList(List<Integer> id) {
        return vehiclebasicService.deleteIdList(id);
    }

    @RequestMapping("/findId")
    public VehiclebasicEntity findId(String id) {
        return vehiclebasicService.findId(id);
    }

    @RequestMapping("/findAll")
    public List<VehiclebasicEntity> findAll(VehiclebasicEntity vehiclebasicEntity) {
        return vehiclebasicService.findAll(vehiclebasicEntity);
    }
    @RequestMapping("/findList")
    public List<VehiclebasicEntity> findList() {
        return vehiclebasicService.findList();
    }
}
